package D12_4z;

import java.util.Scanner;

public class Demo2 {
    public static void main(String[] args) throws Exception {
        Scanner scanner = new Scanner(System.in);
        int num = 0;
        int num1 = 0;
        try {
            System.out.println("请输入第一个数字:");
            num = scanner.nextInt();
            System.out.println("请输入第二个数字:");
            num1 = scanner.nextInt();
        } catch (Exception e) {
            throw new Exception("输入类型错误");
        }
        System.out.println("两数之和为:"+(num+num1));
    }
}
